package com.example.demo.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.demo.service.BookServices;
import com.example.demo.util.R;

import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/book")
@ApiOperation(value = "书管理", tags = "书")
public class BookController {

  @Autowired
  private BookServices bookServices;

  @GetMapping("/info/{id}")
  public R findById(@PathVariable("id") int id) {
    System.out.println("id: " + id);
    return R.success(bookServices.findById(id));
  }

}
